from redis import StrictRedis



class Config():
    DEBUG = None
    # 配置密钥
    SECRET_KEY = "sh66gPEPP4c0GdbUkgVtcAC0L1PsNpO72lyhsK9MZMuwaS7hYr+HtA=="

    # 抽取redis的主机和端口
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379


    # 配置状态保持session信息的存储
    SESSION_TYPE = "redis"
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    PERMANENT_SESSION_LIFETIME = 86400
    # 配置数据库的连接
    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@localhost/lovehome"
    SQLALCHEMY_TRACK_MODIFICATIONS = False


class DevelopmentConfig(Config):
    DEBUG = True

class ProductionConfig(Config):
    DEBUG = False

config_dict = {
    "development":DevelopmentConfig,
    "production":ProductionConfig
}
